package org.geekbang.projects.cs.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.geekbang.projects.cs.entity.staff.CustomerStaff;

/**
 * @description:
 * @author: Kaijun Chen
 * @date: 2023/2/2
 */
public interface CustomerStaffMapper extends BaseMapper<CustomerStaff> {

    default CustomerStaff findCustomerStaffByPhoneNumber(String phoneNumber) {
        LambdaQueryWrapper<CustomerStaff> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CustomerStaff::getPhone, phoneNumber);
        queryWrapper.eq(CustomerStaff::getIsDeleted, false);

        return selectOne(queryWrapper);
    }

}
